<p>Mermaid supports a different layout engine which supports slightly more
  complex diagrams, called the <a href="https://eclipse.dev/elk/">Eclipse Layout Kernel (ELK)</a>.
  Trilium has support for these as well, but it's not enabled by default.</p>
<p>In order to activate ELK for any diagram, insert the following YAML frontmatter
  right at the beginning of the diagram:</p><pre><code class="language-text-x-yaml">---
config:
  layout: elk
---</code></pre>
<table>
  <thead>
    <tr>
      <th>With ELK off</th>
      <th>With ELK on</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        <img src="ELK layout_ELK off.svg">
      </td>
      <td>
        <img src="ELK layout_ELK on.svg">
      </td>
    </tr>
  </tbody>
</table>